<template>
    <div>
        <div class="left_tab">
            <ul>
                <li :class="{active:activess == i }" v-for='(item,i) in list' :key='i' @click="clickType(i)">{{item}}</li>
            </ul>  
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            list:['所有分类','居家','配件服饰','服饰','电器'],
            activess:0
        };
    },
    created() {
    },
    methods: {
        // 获取点击的分类
        clickType(a) {
            this.activess = a
            // 传到父组件
            this.$emit('clickType',a)
            
        }
    },
    //组件挂载
    components: {},
    //计算属性
    computed: {},
    //过滤器
    filters: {},
};
</script>

<style lang="scss" scoped>
.left_tab{
    width: 2rem;
    font-size: .3rem;
    text-align: center;
    color: #675D56;
    ul{
        width: 100%;
        height: 100%;
        li{
            width: 100%;
            line-height: .8rem;
        }
    }
}
.active{
    color:red;
    border-left: 2px solid red;
}
</style>
